<?php

namespace App\Http\Controllers\Api\InnerApi;

use Illuminate\Http\Request;

class ParkManagerController extends InnerApiBaseController
{

    /**
     * 增加设备
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function addDevice(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','park/AddDevice',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 修改车场
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function modify(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','park/Modify',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 设备列表
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function deviceInfo(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','park/DeviceInfos',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 获取车场信息
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function info(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','park/Infos',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 远程操作
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function remoteControl(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','park/RemoteControl',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 停车记录获取
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function parkingRecord(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','park/ParkingRecord',['form_params'=>$request->all()]);

        return $res->getBody();
    }

    /**
     * 添加车场入口
     *
     * @param Request $request
     * @return \Psr\Http\Message\StreamInterface
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function addChannel(Request $request)
    {
        $client  = $this->newHttp();
        $res = $client->request('POST','park/AddChannel',['form_params'=>$request->all()]);

        return $res->getBody();
    }




}
